package com.heiyanqiang.service;

import com.heiyanqiang.domain.Role;
import com.heiyanqiang.domain.UserInfo;
import org.springframework.security.core.userdetails.UserDetailsService;

import java.util.List;

public interface UserService extends UserDetailsService {
    //查询所有用户
    List<UserInfo> findAll() throws Exception;
    //添加用户
    void save(UserInfo userInfo) throws Exception;

    //根据id查询用户详情
    UserInfo findById(Integer id) throws Exception;

    List<Role> findOtherRoles(Integer userId) throws Exception;

    //用户关联角色
    void addRolesToUser(Integer userId, Integer[] roleIds);
}
